package com.xqboss.apps.dto.order;

import com.xqboss.apps.enums.order.OrderTypeEnum;
import com.xqboss.apps.enums.user.PayTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * <p>
 * 创建订单请求体
 * </p>
 *
 * @author Trent
 * @date 2023/8/21
 */
@Data
@ApiModel
public class CreateOrderDto {

    @ApiModelProperty(value = "下单页面生成唯一token, 防止重复下单",required = true)
    @NotNull(message = "请生成下单Token")
    private String token;

    @ApiModelProperty(value = "源ID：盒子订单：盒子ID，充值订单：充值ID，空投：藏品ID", required = true)
    @NotNull
    private Long sourceId;

    @ApiModelProperty("订单类型")
    @NotNull(message = "订单类型错误")
    private OrderTypeEnum orderType;

    @ApiModelProperty("数量")
    @NotNull(message = "请输入商品数量")
    @Min(value = 1, message = "输出数量错误")
    private Integer quantity;

    @ApiModelProperty("金额")
    @NotNull(message = "订单金额异常！")
    private BigDecimal price;

    @ApiModelProperty("支付方式")
    @NotNull(message = "请选择支付方式")
    private PayTypeEnum payType;

    @ApiModelProperty("赠送用户id")
    private Long giftUserId;

}
